- Notifications
You must be signed in to change notification settings - Fork 849
/
Copy pathOML4Py REST API.dsnb
executable file
·1 lines (1 loc) · 24.5 KB
/
OML4Py REST API.dsnb
1
[{"layout":null,"template":null,"templateConfig":null,"name":"OML4Py REST API","description":null,"readOnly":false,"type":"low","paragraphs":[{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["%md"," "],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":true,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","# OML4Py REST API for invoking embedded Python execution","","OML4Py contains a REST API to run user-defined Python functions saved in the script repository. The REST API is used when separation between the client and the Database server is beneficial. For example, REST APIs can be called from a web development application, improving the portability of the interface to other types of platforms, increasing project scalability, and allowing components to evolve independently. Use the OML4Py REST API to build, train, deploy, and manage scripts.","","To run a script, it must reside in the OML4Py script repository. An Oracle Machine Learning cloud service account ***username*** and ***password*** must be provided for authentication.","","### **REST API Workflow**","","In this workflow, we highlight a few of the features of the REST API:","","- authenticating the Database user and obtaining a token","- loading a database table into the Database","- saving scripts in the Database Python script repository","- executing the saved Python scripts from the REST API using both synchronous and asynchronous modes","","","Copyright (c) 2024 Oracle Corporation ","###### <a href=\"https://oss.oracle.com/licenses/upl/\" onclick=\"return ! window.open('https://oss.oracle.com/licenses/upl/');\">The Universal Permissive License (UPL), Version 1.0<\/a>","---"],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"REST API Authentication","message":["%md","","To authenticate and obtain a token, use ***cURL*** with the ***-d*** option to pass the credentials for your Oracle Machine Learning account against the Oracle Machine Learning user management cloud service REST endpoint */oauth2/v1/token*. ",""," $ curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' \\"," -d '{\"grant_type\":\"password\", \"username\":\"'<yourusername>'\", \"password\":\"' <yourpassword>'\"}' "," \"<OML Service URL>/omlusers/api/oauth2/v1/token\""," ","where ","","* _-X POST_ specifies to use a POST request when communicating with the HTTP server","* _--header_ defines the headers required for the request (application/json)","* _-d <data>_ sends the username and password authentication credentials as data in a POST request to the HTTP server","* _Content-Type_ and _Accept_ define the response format (JSON)","* _yourusername_ is the user name of a Oracle Machine Learning user with the default OML_DEVELOPER role","* _yourpassword_ is the password for the user name","* _oml-cloud-service-url_ is the REST server portion of the Oracle Machine Learning user management cloud service instance","","For example, Oracle Machine Learning user ***OMLUSER*** with password ***OMLPASSWD*** and cloud service url ***https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com*** authenticates and obtain a REST token using the following approach:"],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Export token to a variable","message":["%md ","","Copy the \"accessToken\" field from the response and assign it to variable token, surrounded by single quotes.","A token has a lifecycle of 3600 seconds, or 1 hour, and it can be refreshed for up to 8 hours."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","$ export token='eyJhbGciOiJ...'"],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Create an OML Dataframe and load it to an Oracle Database table","message":["%md","","In this example, we load the **iris** data in Python and load the Dataframe into Oracle Database using the ***create*** function. "],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":null,"message":["%python","","import oml","import pandas as pd","","from sklearn import datasets","from sklearn.datasets import load_iris","","iris = datasets.load_iris()","x = pd.DataFrame(iris.data, columns = ['SEPAL_LENGTH','SEPAL_WIDTH','PETAL_LENGTH','PETAL_WIDTH'])","y = pd.DataFrame(list(map(lambda x: {0: 'setosa', 1: 'versicolor', 2:'virginica'}[x], iris.target)), columns = ['SPECIES'])","","try:"," oml.drop(table=\"IRIS\")","except:"," pass"," ","oml_iris = oml.create(pd.concat([x, y], axis=1), table = 'IRIS')","index = oml.DataFrame(oml_iris['SPECIES'])","z.show(oml_iris.head(10))"],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Create a Python script and save it to the OML4Py Script Repository","message":["%md","","In this script, we return the counts for each category in the **SPECIES** column and return the results sorted by the **SEPAL_LENGTH** column using ***oml.group_apply***.","Notice the value for ***group_count*** is a string, not a Python function object, however, the results are the same. The script is invoked from the Python interface, followed by the REST API."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Invoke script from Python","message":["%python","","group_count = \"\"\"def group_count(dat):"," import oml"," import pandas as pd"," return pd.DataFrame([(dat[\"SPECIES\"][0], dat[\"SEPAL_LENGTH\"][0], dat.shape[0])], \\"," columns = [\"SPECIES\",\"SEPAL_LENGTH\", \"COUNT\"])\"\"\"","","try:"," oml.script.drop(\"group_count\")","except: "," pass","oml.script.create(\"group_count\", func=group_count, overwrite=True) "],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Invoke script from the Python API for embedded Python execution","message":["%python","","res = oml.group_apply(oml_iris, index, func=group_count, oml_input_type=\"pandas.DataFrame\",\\"," func_value=pd.DataFrame([('a', 1, 1)], columns=[\"SPECIES\", \"SEPAL_LENGTH\",\"COUNT\"]),\\"," orderby=oml_iris[\"SEPAL_LENGTH\"])","","z.show(res.head(10))"],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"View the Python script in the OML4Py Script Repository","message":["%md","","We can check for the existence of the saved ***group_count*** script from the Python and REST interfaces. From Python, run the OML4Py function ***oml.script.dir***."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":"[{\"raw\":{\"height\":300,\"lastColumns\":[],\"version\":1}}]","hideInIFrame":false,"selectedVisualization":"raw","title":null,"message":["%python","","oml.script.dir(sctype='all')[['name', 'owner']]"],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","## Synchronous REST API calls","Now verify the existence of the ***group_count*** function in the script repository from the REST API with the ***cURL*** command. The default REST API execution mode is *synchronous*, so code execution will wait for the REST API call to return before additional calls may be initiated. ","","The Linux command line JSON parser ***jq*** is used to return the script name and owner. To install jq on your Linux REST client, run the command ***sudo yum install jq***."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["","$ curl -X GET --header \"Authorization: Bearer <token>\" \\"," --header 'Accept: application/json' "," \"<OML Service URL>/oml/api/py-scripts/v1/scripts\" | jq '.result[] | .name + \" \" + .owner'",""," HTTP/1.1 200 OK"," Date: Wed, 09 Mar 2022 21:44:39 GMT"," Content-Type: application/json"," Transfer-Encoding: chunked"," Connection: keep-alive"," Cache-Control: no-cache, no-store, private"," X-Frame-Options: SAMEORIGIN"," X-XSS-Protection: 1;mode=block"," Strict-Transport-Security: max-age=31536000; includeSubDomains"," X-Content-Type-Options: nosniff",""," \"group_count OWNER\""," "],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[{\"type\":\"TextBox\",\"name\":\"omlserver\",\"displayName\":null,\"defaultValue\":\"\",\"argument\":null,\"isHidden\":false,\"isProgrammatic\":false}]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","Invoke the ***group_count*** function in the script repository from the REST API. Set ***parallelFlag*** to true to leverage Database parallelism."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","$ curl -i -X POST --header \"Authorization: Bearer <token>\" \\"," --header 'Content-Type: application/json' \\"," --header 'Accept: application/json' \\"," -d '{\"input\":\"select * from IRIS\", \"parameters\":\"{\\\"oml_input_type\\\":\\\"pandas.DataFrame\\\"}\", \"groupBy\":\"SPECIES\", \"orderBy\":\"SEPAL_LENGTH\", \"parallelFlag\":true}' "," \"<OML Service URL>/oml/api/py-scripts/v1/group-apply/group_count\""],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","The result of the REST execution is a JSON representation of the value returned from the Python script. Dataframes, lists, and dictionaries and ","PNG images are supported. The first portion of the returned value is:"],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","","{\"result\":{\"versicolor_8\":{\"SEPAL_LENGTH\":{\"0\":5.7},\"SPECIES\":{\"0\":\"versicolor\"},\"CNT\":{\"0\":5}},\"versicolor_7\":{\"SEPAL_LENGTH\":{\"0\":5.6},\"SPECIES\":{\"0\":\"versicolor\"},\"CNT\":{\"0\":2}},\"virginica_20\":{\"SEPAL_LENGTH\":{\"0\":6.7},\"SPECIES\":{\"0\":\"virginica\"},....."],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","### **Asynchronous REST API calls**","","*Asynchronous* calls do not wait for the REST API call to return from the server. If the Python script is performing long running computations, results will not be immediate and the user may continue development on the client. The Asynchronous call's returned results are included in the response header. Display the response header by passing the ***-i*** flag to the ***cURL*** command. Asynchronous calls have a default timeout of 1800 seconds, or 30 minutes, and can be extended up to 12 hours. Set the ***asyncFlag*** to ***true*** to run asynchronous calls from the REST API.",""," "],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","","$ curl -i -X POST --header \"Authorization: Bearer <token>\" "," --header 'Content-Type: application/json' "," --header 'Accept: application/json' -d '{\"asyncFlag\":true, \"input\":\"select * from IRIS\", \"parameter\":\"{\\\"oml_input_type\\\":\\\u201cpandas.DataFrame\\\"}\", \"groupBy\":\"SPECIES\", \"orderBy\":\"SEPAL_LENGTH\", \"parallelFlag\":true}' "," \"<OML Service URL>/oml/api/py-scripts/v1/group-apply/group_count\""],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Setting the timeout flag for asychronous jobs","message":["%md","","The ***timeout*** flag is used to change the default timeout setting. ","","Below is the equivalent asynchronous REST call with a timeout of 300 seconds, or 5 minutes. The output includes the HTTP 201 status code indicating the job was created and a job id location that can be polled for status and results."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","","$ curl -i -X POST --header \"Authorization: Bearer <token>\" "," --header 'Content-Type: application/json' "," --header 'Accept: application/json' -d '{\"asyncFlag\":true,\"timeout\":300, \"input\":\"select * from IRIS\", \"parameter\":\"{\\\"oml_input_type\\\":\\\"pandas.DataFrame\\\"}\", \"groupBy\":\"SPECIES\", \"orderBy\":\"SEPAL_LENGTH\", \"parallelFlag\":true}' "," \"<OML Service URL>/oml/api/py-scripts/v1/group-apply/group_count\"",""," HTTP/1.1 201 Created"," Location: <OML Service URL>/oml/tenants/MYTENANT/databases/MYADW/api/py-scripts/v1/<job id location>"," Cache-Control: no-cache, no-store, private"," Content-Length: 0"," X-Frame-Options: SAMEORIGIN"," Proxy-Connection: Keep-Alive"," X-XSS-Protection: 1;mode=block"," X-Content-Type-Options: nosniff"],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Poll the job status","message":["%md","","To poll the job status, pass the job location to ***cURL*** using the GET method. The HTTP response status 302 indicates the currently executing job is found ","and includes a job id location for future results."],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":["","","$ curl -i -X GET --header \"Authorization: Bearer <token>\" \\"," --header 'Accept: application/json' \\"," \"<OML Service URL>/oml/api/py-scripts/v1/jobs/<job id location>\"",""," HTTP/1.1 302 Found"," Date: Wed, 09 Mar 2022 13:04:04 GMT"," Server: nginx/1.18.0"," Cache-Control: no-cache, no-store, private"," Content-Length: 0"," X-Frame-Options: SAMEORIGIN"," Content-Location: http://<oml-cloud-service-instance-url>/oml/tenants/TENANT1/databases/ADWP/api/py-scripts/v1/<job id location>/result"," Proxy-Connection: Keep-Alive"," X-XSS-Protection: 1;mode=block"," X-Content-Type-Options: nosniff"," "],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":"Poll the job at the results location","message":[" ","$ curl -i -X GET --header \"Authorization: Bearer <token>\" "," --header 'Accept: application/json' "," \"<OML Service URL>/oml/api/py-scripts/v1/jobs/<job id location>/result\"","",""," HTTP/1.1 200 OK"," Date: Wed, 09 Mar 2022 13:06:05 GMT"," Server: nginx/1.18.0"," Content-Type: application/json"," Cache-Control: no-cache, no-store, private"," Content-Length: 1038"," X-Frame-Options: SAMEORIGIN"," Proxy-Connection: Keep-Alive"," X-XSS-Protection: 1;mode=block"," X-Content-Type-Options: nosniff"," "],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":"A portion of the returned value","message":["","","{\"result\":{\"versicolor_8\":{\"SEPAL_LENGTH\":{\"0\":5.7},\"SPECIES\":{\"0\":\"versicolor\"},\"CNT\":{\"0\":5}},\"versicolor_7\":{\"SEPAL_LENGTH\":{\"0\":5.6},\"SPECIES\":{\"0\":\"versicolor\"},\"CNT\":{\"0\":2}},\"virginica_20\":{\"SEPAL_LENGTH\":{\"0\":6.7},\"SPECIES\":{\"0\":\"virginica\"},....."],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","### **Returning Model Details from the REST API**","","Let's create a linear model script and run it from the REST API. First, we'll define our function, ***build_lm_rest***, that returns a dict mapping of the model attributes. Note that the model itself cannot be returned directly from REST because LinearRegression models are not JSON-serializable. "],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%python","","build_lm_rest = \"\"\"def build_rest(dat):"," from sklearn import linear_model"," import oml"," regr = linear_model.LinearRegression()"," import pandas as pd"," dat = pd.get_dummies(dat, drop_first=True)"," X = dat[[\"SEPAL_WIDTH\", \"PETAL_LENGTH\", \"PETAL_WIDTH\", \"SPECIES_versicolor\", \"SPECIES_virginica\"]]"," y = dat[[\"SEPAL_LENGTH\"]]"," regr.fit(X, y)"," data = {}"," data[\"init_params\"] = regr.get_params()"," data[\"model_params\"] = mp = {}"," for p in (\"coef_\", \"intercept_\", \"_residues\", \"singular_\"):"," mp[p] = getattr(regr, p).tolist()"," return data\"\"\""],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Save the buld_lm_rest script to the Python script repository","message":["%python","","try:"," oml.script.drop(\"build_lm_rest\")","except: "," pass","oml.script.create(\"build_lm_rest\", func=build_lm_rest, overwrite=True) "],"enabled":true,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":"Invoke the build_lm_rest function in the script repository from the REST API in asynchronous mode.","message":["","","$ curl -i -X POST --header \"Authorization: Bearer <token>\" \\"," --header 'Content-Type: application/json' \\"," --header 'Accept: application/json' \\"," -d '{\"input\":\"select * from IRIS\", \"parameters\":\"{\\\"oml_input_type\\\":\\\"pandas.DataFrame\\\"}\"}' "," \"<OML Service URL>/oml/api/py-scripts/v1/table-apply/build_lm_rest\""],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":"The returned value is a dict containing model attributes","message":["","{\"result\":{\"init_params\":{\"fit_intercept\":true,\"n_jobs\":null,\"normalize\":false,\"copy_X\":true},\"model_params\":{\"intercept_\":[2.1712662921550736],\"_residues\":[13.556485081974792],\"coef_\":[[0.4958889383885511,0.8292439122348054,-0.315155173326473,-0.7235619577807288,-1.0234978144908309]],\"singular_\":[23.873627650888057,7.279716799977891,4.192696791126727,2.194192042042924,0.7289542732694926]}}}"],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","## End of Script"],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md"],"enabled":true,"result":null,"sizeX":0,"hideCode":true,"width":12,"hideResult":true,"dynamicFormParams":null,"row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"}],"version":"6","snapshot":false,"tags":null}]